package com.su.lesson01;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class testBorderLayout {
    public static void main(String[] args) {
        Frame frame = new Frame("BorderLayout");
        Button east = new Button("East");
        Button west = new Button("West");
        Button south = new Button("South");
        Button north = new Button("North");

        frame.add(east, BorderLayout.EAST);
        frame.add(west, BorderLayout.WEST);
        frame.add(south, BorderLayout.SOUTH);
        frame.add(north, BorderLayout.NORTH);
        //弹窗位置、大小
       frame.setBounds(200,200,500,500);
       //弹窗颜色
       frame.setBackground(new Color(38, 190, 224));
       frame.setResizable(false);

       frame.setVisible(true);
        //监听
       frame.addWindowListener(new WindowAdapter() {
           @Override
           public void windowClosing(WindowEvent e) {
               System.exit(0);
           }
       });
    }
}
